package com.itcs.trading.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.itcs.trading.model.UserBankInfo;
import com.itcs.trading.model.UserBankInfoKey;

public interface UserBankInfoMapper {
    int deleteByPrimaryKey(UserBankInfoKey key);

    int insert(UserBankInfo record);

    int insertSelective(UserBankInfo record);

    UserBankInfo selectByPrimaryKey(UserBankInfoKey key);

    int updateByPrimaryKeySelective(UserBankInfo record);

    int updateByPrimaryKey(UserBankInfo record);

	/** 
	* @Title: findBankCard 
	* @Description: 银行卡列表
	* 	user_bank_info,user_customer_info
	* @param userId
	* @return List<Map<String,Object>>
	* @throws 
	*/
    @Select("select "
    		+ "b.user_id user_id,"
    		+ "b.agent_name agent_name,"
    		+ "b.agent_id_num agent_id_num,"
    		+ "b.mobile mobile,"
    		+ "a.bankcard_no bankcard_no,"
    		+ "a.bank_name bank_name,"
    		+ "a.bankcard_type bankcard_type,"
    		+ "a.create_time create_time,"
    		+ "a.bankcard_state bankcard_state,"
    		+ "a.update_time update_time,"
    		+ "a.remark remark "
    		+ "from user_bank_info a ,user_customer_info b "
    		+ "where a.user_id=b.user_id and b.user_id=#{userId}")
	List<Map<String, Object>> findBankCard(@Param("userId")Long userId);
}